

package com.hazelcast.map.impl.iterator;

import com.hazelcast.map.impl.proxy.MapProxyImpl;

/**
 * Iterator for iterating map entries in the whole cluster. The values
 * are fetched in batches.
 * It uses {@link MapPartitionIterator} and provides the same guarantees
 * with this partition iterator.
 *
 * @see MapPartitionIterator
 */
public class MapIterator<K, V> extends AbstractMapIterator<K, V> {

    public MapIterator(MapProxyImpl<K, V> mapProxy, int fetchSize, int partitionCount, boolean prefetchValues) {
        super(partitionId -> mapProxy.iterator(fetchSize, partitionId, prefetchValues), partitionCount);
    }

    public MapIterator(MapProxyImpl<K, V> mapProxy, int partitionCount, boolean prefetchValues) {
        this(mapProxy, DEFAULT_FETCH_SIZE, partitionCount, prefetchValues);
    }
}
